<template>
  <div class="app-container">
    <el-tabs v-model="activeName" type="card" @tab-remove="removeTab">
      <el-tab-pane label="处置列表" name="1">
        <template v-if="activeName === '1'">
          <List></List>
        </template>
      </el-tab-pane>
      <el-tab-pane label="与我相关" name="2">
        <template v-if="activeName === '2'">
          <Related ref="iscond"></Related>
        </template>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: "disposal",
  // dicts: ['sys_notice_status', 'sys_notice_type'],
  components: {
    List: () => import('./list/index.vue'),//列表
    Related: () => import('./related/index.vue')//与我相关
  },
  data () {
    return {
      activeName: '1',
      tabIndex: false,
      rowObj: {}
    };
  },
  watch: {
    activeName (val) {
      if (val != '2') {
        if (this.$route.query.isCondition) {
          this.$route.query.isCondition = undefined
        }
      }
    }
  },
  computed: {
    isCondition: {
      get () {
        return this.$store.state.user.isCondition
      }
    },
  },
  created () {
    this.activeName = this.isCondition
    if (this.isCondition === '2') {
      setTimeout(() => {
        this.$refs['iscond'].$refs['reftable'].getList({ auditStatus: '1' });
      }, 500);
    }
  },
  methods: {
    removeTab () {
      this.tabIndex = false
      this.activeName = '1'
    },
    // addTab(row){
    //   this.tabIndex = true
    //   this.activeName = '3'
    //   this.rowObj = row
    // }
  }
};
</script>
